package com.browan.freeppmobile.jni;

import android.content.Context;
import android.media.MediaPlayer;

import com.browan.demo.R;

public class RingUtil {

	private static MediaPlayer mPlayer = null;
	
	public static void startRingback(Context context)
	{
		if(mPlayer == null) 
			mPlayer = MediaPlayer.create(context, R.raw.ringback);
		
		mPlayer.setLooping(true);
		mPlayer.start();
	}
	
	public static void stopRingback()
	{
		if(mPlayer != null) {
			if(mPlayer.isPlaying()) {
				mPlayer.stop();
				mPlayer.reset();
			}
		}
	}
	
}
